//
//  NSString+GHY_Width.m
//  Camera
//
//  Created by aaaaaa on 16/8/19.
//  Copyright © 2016年 葛海一. All rights reserved.
//

#import "NSString+GHY_Width.h"

@implementation NSString (GHY_Width)

+ (CGFloat)getTextHeight:(NSString *)text withWidth:(CGFloat)width withFontSize:(NSInteger)size{
    NSDictionary *dic = @{
                          NSFontAttributeName : [UIFont systemFontOfSize:size]
                          };
    
    CGRect rect = [text boundingRectWithSize:CGSizeMake(width, 1000) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    
    return rect.size.height;
    
}

@end
